﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 继承01
{
    // 基类、父类
    class Animal //: Object 所有类都默认继承自Object类
    {
        public int ID { get; set; }
        public string Name { get; set; }

        public Animal()
        {
            Console.WriteLine("Animal无参构造");
        }

        public Animal(int id)
        {
            ID = id;
            Console.WriteLine("Animal——1个有参构造");
        }

        public Animal(int id, string name):this(id)
        {
            Name = name;
            Console.WriteLine("Animal——2个有参构造");
        }

        public void Run()
        {
            Console.WriteLine("Animal is Running....");
        }
    }
}
